<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:xdt="http://www.w3.org/2005/xpath-datatypes">
	<xsl:output method="xhtml" indent="yes" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"/>
	<xsl:include href="DelphiDoc.Shared.xslt"/>
	<xsl:template match="/namespace/class/members">
		<div class="membersTitle"><xsl:value-of select="../@name"></xsl:value-of> Members</div>
		<div class="members">
			<div>
			Fields<br/>
				<xsl:apply-templates select="field" mode="brief"/>
			</div>
			<div>
			Constructor<br/>
				<xsl:apply-templates select="constructor" mode="brief"/>
			</div>
			<div>
			Procedure<br/>
				<xsl:apply-templates select="procedure" mode="brief"/>
			</div>
			<div>
			Function<br/>
				<xsl:apply-templates select="function" mode="brief"/>
			</div>
		</div>
	</xsl:template>
	<xsl:template match="procedure" mode="brief">
		<div class="procedureTitle">
			<xsl:value-of select="@name"/>
		</div>
		<xsl:if test="devnotes">
			<div class="procedure">
				<xsl:apply-templates select="devnotes" mode="brief"/>
			</div>
		</xsl:if>
	</xsl:template>
	<xsl:template match="function" mode="brief">
		<div class="functionTitle">
			<xsl:value-of select="@name"/>
		</div>
		<xsl:if test="devnotes">
			<div class="function">
				<xsl:apply-templates select="devnotes" mode="brief"/>
			</div>
		</xsl:if>
	</xsl:template>
	<xsl:template match="field" mode="brief">
		<div>field: <xsl:value-of select="@name"/>
		</div>
	</xsl:template>
	<xsl:template match="constructor" mode="brief">
		<div>constructor: <xsl:value-of select="@name"/>
		</div>
	</xsl:template>
	<xsl:template match="devnotes" mode="brief">
		<xsl:choose>
			<!-- If devnotes has sub elements assume it's in Microsoft Comment Documentaion or NDoc format -->
			<xsl:when test="*">
				<xsl:apply-templates select="summary"/>
			</xsl:when>
			<!-- Otherwise just dump out devnote element contents -->
			<xsl:otherwise>
				<div class="devnotes">
					<xsl:value-of select="."/>
				</div>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
</xsl:stylesheet>
